#ifndef ANNOTATION_H
#define ANNOTATION_H

#include <QtCore>
#include <QColor>

class TextNoteAnnotation
{
public:
	TextNoteAnnotation(QByteArray docHash = QByteArray(), int id = -1, int pageNumber = 0);

	QByteArray getDocHash();
	int getId();
	int getPageNumber();

	QString getTitle();
	void setTitle(QString title);

	QString getRichText();
	void setRichText(QString text);

	QColor getColor();
	void setColor(QColor color);

	// in normalized page coords (0.0,0.0 = top left page corner; 1.0,1.0 = bottom right)
	QPointF getPos();
	void setPos(QPointF pos);

	bool getMaximized();
	void setMaximized(bool maximized);

	QSize getMaximumSize();
	void setMaximumSize(QSize maximumSize);

	friend QDataStream& operator<<(QDataStream& out, const TextNoteAnnotation& n);
	friend QDataStream& operator>>(QDataStream& in, TextNoteAnnotation& n);

protected:
	QByteArray docHash;
	int id;
	int pageNumber;
	QString title;
	QString richText;
	QColor color;
	QPointF pos;
	bool maximized;
	QSize maximumSize;
};

QDataStream& operator<<(QDataStream& out, const TextNoteAnnotation& n);
QDataStream& operator>>(QDataStream& in, TextNoteAnnotation& n);

class HighlightAnnotation
{
public:
	HighlightAnnotation(QByteArray docHash = QByteArray(), int pageNumber = 0, QRectF bbox = QRectF(), QColor color = Qt::yellow);

	QByteArray getDocHash();
	int getPageNumber();

	// in normalized page coords (0.0,0.0 = top left page corner; 1.0,1.0 = bottom right)
	QRectF getBBox();

	QColor getColor();
	void setColor(QColor color);

	friend QDataStream& operator<<(QDataStream& out, const HighlightAnnotation& n);
	friend QDataStream& operator>>(QDataStream& in, HighlightAnnotation& n);

protected:
	QByteArray docHash;
	int pageNumber;
	QRectF bbox;
	QColor color;
};

QDataStream& operator<<(QDataStream& out, const HighlightAnnotation& n);
QDataStream& operator>>(QDataStream& in, HighlightAnnotation& n);

#endif // ANNOTATION_H
